home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 March / Ahoy_Magazine_87-03_1987_Double_L.d64 / Time Converter2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  349b  |  12 lines

  1. 0 print"[147]":poke53280,0:poke53281,0:poke646,1
  2. 1 rem commodares problem #35-3:
  3. 2 rem      time converter
  4. 3 rem solution by
  5. 4 rem      leo brenneman
  6. 5 rem
  7. 10 input"time in decimal hours";h
  8. 20 h%=h : m=h-h% :m=m*60 : m%=m : s=m-m% : s=s*60 : s%=s : if s=>.5 then s%=s+1
  9. 30 if s%=>60 then m%=m%+1 : s%=0
  10. 40 if m%=>60 then h%=h%+1 : m%=0 : s%=0
  11. 50 print h% chr$(58) m% chr$(58) s%
  12.